package cuiyt.designpattern.responsibility.dem01;

/**
 * @author cyt
 * @create 2020-07-20 14:28
 */
public class TwoApprover extends BaseApprover {
    public TwoApprover(String name) {
        super(name);
    }

    private long min = 0;
    private long max = 5000;

    @Override
    public void processRequest(Request request) {
        if (request.getPrice() > min && request.getPrice() <= max) {
            System.out.println("请求编号 => " + request.getId() + "处理 = 》 " + this.name);
        } else {
            approver.processRequest(request);
        }
    }
}
